//q5a.cpp
//The program takes an equation of ax + b = 0 and return x
//
//Binyamin 22 december 2017
//-----------------------------------------------------------
#include <iostream>

using namespace std;

//1. Prompt the user for a and b.
//2. capture a and b.
//3. calculate x.
//4. print x.

int main()
{
	double a; // a - a as inserted by the user.
	double b; // b - b as inserted by the user.
	double x; // x - the calculate of x by the format.
	cout << "Please enter a and b for ax + b = 0" << endl;
	cin >> a >> b;
	if( a == 0)
	{
		cout << "The equation have no values" << endl;
	}
	else // a != 0
	{
		x = b/a * -1;
		cout << "The value of x is " << x << endl;
	}
	return 0;
}
//output
//Please enter a and b for ax + b = 0
//2 -6
//The value of x is 3
